﻿using System.IO;

namespace SimbaRGVMonitor.Common.Utils
{
    public static class FileUtil
    {
        public static void WriteTextToFile(string filePath, string text, FileMode mode = FileMode.OpenOrCreate)
        {
            using (var file = new FileStream(filePath, mode))
            using (var writer = new StreamWriter(file))
            {
                writer.Write(text);
            }
        }

        public static void WriteLineToFile(string filePath, string text, FileMode mode = FileMode.OpenOrCreate)
        {
            using (var file = new FileStream(filePath, mode))
            using (var writer = new StreamWriter(file))
            {
                writer.WriteLine(text);
            }
        }
    }
}
